Implemented a check to guard against inconsistent API responses