Writing controllers and model validations