RestApi - refactoring