Added form validation using ui-validate, still needs better unit tests