Restructured the controller to aid testing and added dummy tests