use the pymongo driver if it is available, fallback to the REST api if pymongo driver is not available