changed the model serialization api