Added validation of email and username uniqueness.