Initial commit of Query API code.