Added support for OAuth tokens and fixed bug in query auto fetch.