add query test and begin impl