updated to work with OAuth and API v1.1