Updated to allow embedding in APMRouter, and use same DB instance as
APMRouter.