Fixed errors in controller, added phpunit