public function setEnvironment($env = self::ENV_PRODUCTION)
    {
        if ($env != self::ENV_DEVELOPMENT && $env != self::ENV_PRODUCTION) {
            throw new RestException('Unknown environment "' . $env . '".');
        }

        $this->environment = $env;
    }