add some utility methods for validation, do required field validations for signup and login