Validation for controller and model.