Add validation and flash messages.