Replacing pickle with json