extract call api auth method to a variable in the signin servlet as well