Code refactoring concerning RESTful API.