private function execute(&$http) {
      $result = curl_exec($http);

      if($result === false) {
        $error_code = curl_errno($http);
        $error_message = curl_error($http);

        curl_close($http);

        throw new CallFailed($error_code, $result, $error_message);
      } else {
        $status = (integer) curl_getinfo($http, CURLINFO_HTTP_CODE);

        curl_close($http);

        switch($status) {
          case 200:
            return $result;
          case 400:
          case 401:
          case 403:
          case 404:
          case 409:
          case 500:
          case 503:
          if(is_string($result) && substr($result, 0, 1) === '{') {
            throw new AppException($status, $result); // Known application exception
          } // if
        } // switch

        throw new CallFailed($status, $result); // Unknown exception
      } // if
    }