Add link to stats endpoint in context and query posthook