public function getRoutesAction()
    {
        $response = array();

        $schemeAndHost = $this->get('request_stack')->getCurrentRequest()->getSchemeAndHttpHost();
        // Get rid of dev environment (app_dev.php).
        $baseUrl = $this->get('router')->getContext()->getBaseUrl();
        $this->get('router')->getContext()->setBaseUrl('');

        $routeCollection = $this->get('router')->getRouteCollection();

        foreach ($routeCollection->all() as $name => $route)
        {
            $options = $route->getOptions();
            if(
                isset($options['campaignchain']) &&
                isset($options['campaignchain']['rest']) &&
                isset($options['campaignchain']['rest']['expose']) &&
                $options['campaignchain']['rest']['expose']
            ){
                $routeData = array(
                    'url' => $schemeAndHost.$this->generateUrl($name),
                    'name' => $name,
                );

                if(isset($options['campaignchain']['description'])){
                    $routeData['description'] = $options['campaignchain']['description'];
                }

                $response[] = $routeData;
            }
        }

        // Reset to previous environment.
        $this->get('router')->getContext()->setBaseUrl($baseUrl);

        return $this->response(
            $response
        );
    }