serialize data for storage in redis