Implemented unit test for controller methods