private function applyRouteParameters($uri, array $parameters, array &$additionalParams = array())
    {
        $result = $uri;

        foreach ($parameters as $key => $value) {
            $count = 0;
            $result = str_replace('{'.$key.'}', $value, $result, $count);

            if (0 === $count) {
                $additionalParams[$key] = $value;
            }
        }

        return $result;
    }