call API only when credentials are provided