PullicIds and query regarding python script

update the response format of publicIds and remove the error caused by query regarding to python script.