refactored services, controllers, routes