private function loadVersion() {
        $headers = $this->request->header();
        if (isset($headers['api-version'])) {
            $rawVersion = array_shift($headers['api-version']);
            $version = strtolower($rawVersion);
            if (is_numeric($version)) {
                $this->version = 'v'.$version;
            } else {
                $this->version = $version;
            }
        } else {
            $this->version = self::DEFAULT_VERSION;
        }

        if (!in_array($this->version, $this->versions)) {
            throw new VersionException($rawVersion . " is an invalid version number.");
        }
    }