Refactoring controllers for pure REST endpoints.