Change serialize/deserialize to to_json/from_json