protected function route(Context $context)
    {
        $this->logger->debug('kernel.route: find route from http query');

        // logic already specified
        if($context->logic) {
            $this->logger->debug('kernel.route: forward to #' . $context->logic->name . ', skip routing');
            return $context;
        }

        // find route
        $query = $context->request->method . ' ' . $context->request->uri->path;
        $route = $this->router->find($query);

        // 404
        if(!$route) {
            throw new NotFoundException('No route found for query ' . $query);
        }

        // update context
        $context->route = $route;
        $context->params = $route->params;
        $context->logic = $route->resource;

        $this->logger->debug('kernel.route: #' . $context->logic->name . ' found for query ' . $query);

        return $context;
    }