public function __construct($module = NULL, $defaultFormat = 'json')
{
if (!array_key_exists($defaultFormat, $this->formats)) {
throw new InvalidArgumentException("Format '{$defaultFormat}' is not allowed.");
}
$this->module = $module;
$this->defaultFormat = $defaultFormat;
}