refactor RestRouter