protected function createApiClient() {
    // Provide a BC switch between guzzle 5 and guzzle 6.
    if (class_exists('GuzzleHttp\Psr7\Response')) {
      $this->apiClient = new Client(array("base_uri" => $this->getPhantomJSHost()));
    }
    else {
      $this->apiClient = new Client(array("base_url" => $this->getPhantomJSHost()));
    }
  }