added validation to controller, models, and views