private function getRequestPath($resource, $action, &$params)
    {
        if (!isset($this->resources[$resource]) || !isset($this->resources[$resource][$action])) {
            throw new \UnexpectedValueException('Resource path not found');
        }

        // get path
        $path = $this->resources[$resource][$action];

        // replace variables
        $matchCount = preg_match_all("/:(\w*)/", $path, $variables);
        if ($matchCount) {
            foreach ($variables[0] as $index => $placeholder) {
                if (!isset($params[$variables[1][$index]])) {
                    throw new \InvalidArgumentException('Missing parameter: ' . $variables[1][$index]);
                }

                $path = str_replace($placeholder, $params[$variables[1][$index]], $path);
                unset($params[$variables[1][$index]]); // remove parameter from $params
            }
        }

        return $path;
    }