Fix crash when JSON response fails to parse