Refactoring RestApiHelper