I really don't get what you're confused about. Yes, the existence of the API is good and useful. What Valve should do, if they really cared about stopping CS or TF2 gambling, is to limit access to this API for the gambling sites. The API should ONLY be accessible to individual players. That means IP restrictions, client agent sniffing, bot behavior analysis, etc - not trivial, and not foolproof, but also not exactly rocket science.