new serialization/deserialization methods learned from webapi