Fixed a bug in api.py that was causing an error with oauth_dance