New serialization API