added validations for form, with basic ajax error handling