Looking back, I think this approach is actually pretty brilliant.
It's simple, understandable, and absolutely waterproof.
These criteria make it the best solution. (y)
If I were you, I would implement it this way and throw the APIs overboard.
If I ever find myself in this situation, I hope...