Switching to json.dumps and testing looped construction