convert pickle to new JSON object