The current router has synthesizability problems because it wraps in an immediate function. In particular, nested routers are difficult to see.
A stateful object-based router improves composability and simplifies nesting.
Add a stateful Router that declares an HTTP method, a URL path, and registers a handler.