[fix] stop parsing after we have enountered an error
[test] added missing tests for invalid responses