Moving API services out of the controller.