public function addMethod($alias, $service, $method, $overwrite = false)
    {
        if (!isset($this->functions)) $this->functions = array();
        if (isset($this->functions[$alias]) && !$overwrite) {
            throw new \InvalidArgumentException('JsonRpcController: The function "' . $alias . '" already exists.');
        }
        $this->functions[$alias] = array(
            'service' => $service,
            'method' => $method
        );
    }