implemented TT serialiser to JSON