Impl all controller methods and added test cases