Api query tests