Added email validation and tests