integrated google APIs and fixed authentication logic