bug in api query