Updates example script to handle json correctly in py2 and py2