added validation to user registration and adjusted tests to handle the validations