added test for custom json encoder