align router code with 1.2.1 version of rest