Hi Alex,
IMO I rather use a more functional style than relying on require.cache to obtain the app instance. Since I'm sometimes get wary with global state, I prefer to have control over the execution flow. Almost everything that needs to use LB in my codebase has some sort of app instance passing parameter, it may be like server/boot scripts' style with module.exports = app => { ... } or model extensions within server/models/<model>/<extension-n>.js getting the model like module.exports = <model> => { ... } and extracting instance directly from model with <model>.app
Sometimes we got issues extracting the app instance directly from the exported closure, so we moved the extraction directly into the extended methods. I think this is useful since app instance extraction is deferred until used in model's methods and not captured without change in the exported closure. I think I remember reading LB source code that the app instance is not a direct property of a model but something more complicated.
Moreover, passing app instance as a parameter gives you more control over the whole app' state when you do unit or integration testing.
It may be helpful to use ES6 classes to encapsulate the app instance but I have not so much experience with this lang feature, YMMV.
Finally, I'd rather leverage LB to take care of ReportsAPI as a private model in the system (server/model-config.json with public: false prop) and being able to fetch the model with const Report = Team.app.models.Report and then use some function of it, Report.fetchStats( ... ) (defined in server/models/report/methods.js). If you come to use different APIs for reports, make different models for them, like <ServiceA>Report, <ServiceB>Report, etc.
Disclaimer: This is a highly opinionated recommendation of how I would do these things, I do not know if any of what I said is "the best way" to do the job, but it
has worked very well for me and my team, since it tries to be concise, leverages LB as a framework and keeps global state healthy.
I hope you find this info helpful.
Regards.