// If a Discovery Auth token is set, use it.
if (Config.getDiscoveryAuthToken() != null) {
request.addHeader("Authorization", "OAuth " + Config.getDiscoveryAuthToken());
}
request.send(new AsyncCallback<ApiResponse>() {
@Override
public void onSuccess(ApiResponse response) {
// Determine if we got a 3XX or 4XX response and call failure if so.
int responseClass = response.getStatus() / 100;
if (responseClass > 3) {