WIP: intial work on query services functions.