Replace getdict() with dict.get(), which had the same functionality as 

...the build-in method.

FYI, was looking at this because Alberto and I were discussing potential problems for using this fallback when the IP of the machine hosting the API isn't know.