Add test for json_encode