In line 167 you have a timeout of 100milliseconds, the API states though that you should limit your queries to once every 10 seconds,
you should change the timeout from '100' to '10000' (10000milliseconds -> 10 seconds)
Just to be on the save side, I'd change it to 11000 or 12000
Not sure if that was all, but that's what cought my attention at the first glance
- hope this helps!