public function handleEnvironment($route)
{
$params = $route->getParams();
if (!is_numeric($params['environment']) || $params['environment'] <= 0) {
throw new ApiErrorException(400, ErrorMessage::ERR_INVALID_VALUE, "Environment has not been provided with the request");
}
$this->settings[self::SETTING_SCALR_ENVIRONMENT] = (int) $params['environment'];
unset($params['environment']);
$route->setParams($params);
}