public function build($type, $data, $hypertextRoutes = [])
    {
        if (!isset($this->types[$type])) {
            throw new \Exception("Unknown response type.");
        }
        return new $this->types[$type]($data, $hypertextRoutes);
    }