Added serialize/deserialize API