api query fix