Added validation and tests for the user model