serialize to objects that can be stored as json