serialize and deserialize tox data