private function parse_result($data) {
    try {
      if ($this->resp_type == 'json') {
        $result = @json_decode($data);
      } else {
        $result = @simplexml_load_string($data);
      }
    } catch (Exception $e) {
      throw new GiantBombException('Parse error occoured', null, $e);
    }

    if (empty($result)) {
      throw new GiantBombException('Unknown error occured');
    } else if (!empty($result->error) && strtoupper($result->error) != 'OK') {
      throw new GiantBombException('Following error encountered: ' . $result->error);
    }

    return $result;
  }