Internal Illusions
While I agree that the centralized location within this mod is not ideal for me (since I have to find, fix, and release) or you (since you have to understand it first then do it yourself, or at least notify me), as it stands I don't know of a good way around that with the current implementation and restrictions. As you could probably tell, it was built specifically for Space Exploration, since they were not really interested in putting any work on their side that wasn't simply "blocking" their own entities from being placed at all outside of their known locations. And before 2.0, the majority of encountered issues were with abandoned mods that would not never be fixed.
The illusions solve a more specific problem, though: users want to build literally anything in the Sandboxes, and when they cannot for whatever reason, they want to feel like they still can, even if that thing doesn't do anything. So, problematic entities are replaced with the illusions, which are basically cardboard cutouts of the same thing, and usually when copying/blueprinting they are swapped for the real things.
To do that, notice that Illusions must be known in the prototype stage. I assume by your phrasing that by "API" that can be "called" you meant using Remote Calls, but that is only available in the control stage, so it's not possible to do that. Right now, I cannot imagine any viable solution within the control stage, as it's perhaps the worst of all stages to do it in.
Alternatives
As for the proper long-term solution that, according to you, is not a poor implementation, there are possibilities but whether the right answer is among them is not clear.
External Illusions
It may be possible, but I have not seen it done, for this mod to provide functions that would generate the illusory prototypes such that other mods could depend on this and include them in their own prototypes. I can see how this would increase the save startup time since I'd need a new strategy to know about all illusions and their real counterparts, but it's the most direct way to expose the current functionality. If the dependency is necessary, it has load order implications, and all of this is ultimately harder to verify as working.
Surface Conditions
New to Factorio 2.0, Surface Conditions allow restricting things like building placement and recipe selections based on values known for each surface. If all you care about is prevention, then Illusions are overkill, and the implementation is essentially adding a "placeable only when sandbox is false" condition on the relevant prototypes. The only drawback is that Factorio recently added an "ignore all surface conditions" flag that users now have available, and I'd probably remove that functionality because it conflicts with consistency goals.