added controller and refactored services