use our json encoder everywhere