Fix incomplete JSON response analysis in tests