Added validation and updated controller tests.