Added form validation and better routing