Feature/controller testing

Add tests for all controllers. Make some minor changes to the controllers.