moved api controller to a service