core/apiRouter: move all routing to newRouter(), update tests