added validations and user controller functionality