Added form validation, unit testing and exception handling