I don't know enough about the API call to describe how to know, or change, if you are counting repeat instances. But in Ad Hoc you can access it from the bottom of the screen (Count Repeat Instance: Yes/No) or from the global settings (Tools > Settings). The first option is a checkbox to count repeat instances.
If you aren't including repeat instances in Ad Hoc, run everything again including repeat instances. If the API call and Ad Hoc match at that point then you know that was the culprit (then the challenge becomes turning off repeat instance in the API).