String getUrl(GoPubMedServiceKey service) throws IOException {
    String serviceUrl = config.getString(service.getKey());
    if (config.getBoolean(REQUIRE_SESSION_URL)) {
      return timeout(serviceUrl) ? updateSessionUrl(serviceUrl) : getSessionUrl(serviceUrl);
    } else {
      return serviceUrl;
    }
  }