python wrapper for api