add sphinx api functional test for query