replaced os.system() by subprocess.call(), added oauth2 support