Refactoring API with RESTFul API extension