python api implementation minor format changes

python api implementation minor format changes to bring more in sync
with nodejs implementation