Handle invalid JSON responses