Refactored rest controller, moved methods to its own service