reorganized rest api controllers to use dependency injection