protected function parseResponse($response)
 {
     $return = [];
     try {
         $body = trim((string) $response->getBody());
         $body = json_decode($body);
     } catch (\Exception $e) {
         $body = false;
     }
     if (isset($body->errors)) {
         return $body;
     } else {
         if (isset($body->{$this->_api_name})) {
             $class = new $this->_collection_name((object) $body->{$this->_api_name});
             $class->setErrors($this->_has_error);
             return $class;
         } else {
             if (is_array($body)) {
                 foreach ($body as $key => $item) {
                     if (isset($item->{$this->_api_name})) {
                         $return[] = new $this->_collection_name((object) $item->{$this->_api_name});
                     } else {
                         $return[] = new $this->_collection_name((object) $item);
                     }
                 }
             } else {
                 if (is_object($body)) {
                     foreach ($body as $item) {
                         $class = new $this->_collection_name((object) $item);
                         $class->setErrors($this->_has_error);
                         return $class;
                     }
                 } else {
                     $return = ['errors' => [$response->getReasonPhrase()], 'code' => $response->getStatusCode(), 'request_url' => $response->getEffectiveUrl()];
                 }
             }
         }
     }
     $this->_data = $return;
     $c = new Collection($this->_data);
     $c->setErrors($this->_has_error);
     return $c;
 }