API for $app->nextRoute() and $app->nextCallback()