Add test to check json from err