Finished mock implementation of serialization