Fix for KeyError

This happens with OAuth isn't setup correctly or you use the wrong
endpoint.
Merge pull request #5 from robhudson/key-error

Fix for KeyError