implement serialize and deserialize data object