I have a script that I'm using to download services as a geodatabase using the REST api. It works about half the time -- the other half the time I get a 500 error stemming from a 'No JSON object could be decoded' error. Anyone have any idea why this might be happening? I don't think it's a bug in my script, since it works sometimes, but I've attached it in case anyone has any ideas and wants to see how it's put together. Any feedback is greatly appreciated!