an example shows how to use custom json encoder