add json en/decode functions