refactor(rest) api