Add authentication check to api call.