REST API refactoring