compress and decompress json objects