update the python script and API