Implement `/api/ref` (again, untested).