public function setEncoder($name, $encoder = null)
    {
        if (!isset($encoder)) {
            $encoder = '\OtherCode\Rest\Modules\Encoders\\' . strtoupper($name) . 'Encoder';
        }

        if (class_exists($encoder, true)) {
            $this->registerModule($name, new $encoder($this->request), 'before');
        } else {
            throw new \OtherCode\Rest\Exceptions\ModuleNotFoundException('Encoder ' . $name . ' not found!');
        }
        return $this;
    }