Added tests and validation for the user