Switch from pickle to JSON for sending data