public function createAppropriateIterator(Response $response)
    {
        $this->checkResponseFormat($response);

        set_error_handler(function() { /* ignore errors */ });
        $arr = json_decode($response->getBody(), true, 512, 1);
        restore_error_handler();

        $objects = [];
        foreach ($arr['objects'] as $object) {
            if (isset($this->apiEntities[$object['type']])) {
                $class = $this->apiEntities[$object['type']];
            } else {
                $class = $this->apiEntities['*'];
            }
            $objects[] = new $class($object);
        }

        return new EntityIterator($objects, $response);
    }