Results length returned from the API will not trigger break if it equals to limit.
In line 677:
if len(results) < limit:
break
I am setting limit to 1 and results returned with size 1 will not meet this condition and causing additional API calls, even thought the limit has reached.
The fix:
if len(results) <= limit:
break