api for the authentication process