add validation for login in api