add query service code.