Changed from encode to dump as decode will be deprecated in multi_json.