Added tests to controllers and models