You cannot just "change the APIs" to inject ads—ads require a lot of external verifiable measurement and have specific requirements over display and placement that third-party apps can't provide. Injecting ads into existing third-party apps would mean putting specific requirements for measurement SDKs (binary third-party code from trusted adstech vendors) and developing a lot of new APIs for reporting that that third-party developers would have to implement