encode all non-string values as json