Dynamic query API