change serialiser to JSON and clear the tests