changed python script for api changes