Fix test case for extractAPIErrors