protected function lang($language)
    {
        $pos = array_search($language, $this->request->getAcceptLanguage());
        if ($pos === FALSE) {
            throw new NotAcceptableException('No matching method for response type "'.join(', ', $this->request->getAcceptLanguage()).'"');
        }
        return count($this->request->getAcceptLanguage()) - $pos;
    }