protected function callApi($url)
    {
        $url = $this->apiBaseUrl . $url;

        $options = array(
            'http' => array(
                'method' => 'POST',
                'header' => 'Content-Type: application/x-www-form-urlencoded',
                'ignore_errors' => true,
                'content' => http_build_query($this->parameters, '', '&')
            )
        );

        $context = stream_context_create($options);

        $fp = fopen($url, 'rb', false, $context);
        if (!$fp) {
            throw new RuntimeException(
                sprintf(
                    'Could not connect to NMA API URL %s',
                    var_export($url, true)
                ),
                500
            );
        }

        $res = stream_get_contents($fp);
        if ($res === false) {
            throw new RuntimeException(
                sprintf(
                    'Could not fetch data from NMA API URL %s',
                    var_export($url, true)
                ),
                500
            );
        }

        $xml = simplexml_load_string($res);
        if ($xml === null) {
            throw new RuntimeException(
                sprintf(
                    'Could not decode NMA API response for URL %s as XML. ' .
                    'Response was: %s',
                    var_export($url, true),
                    var_export($res, true)
                ),
                500
            );
        }

        return $this->processXmlReturn($xml);
    }