Used google-api-python-client instead of urlfetch. Minor bug fix and cleanup