private function executeQuery($query)
{
$query = $this->buildQuery($query);
$request = $this->getMessageFactory()->createRequest('GET', $query);
$content = (string) $this->getHttpClient()->sendRequest($request)->getBody();
if (empty($content)) {
throw new NoResult(sprintf('Could not execute query "%s".', $query));
}
$json = json_decode($content);
// API error
if (!isset($json)) {
throw new NoResult(sprintf('Could not execute query "%s".', $query));
}
return $json;
}