Improve query API syntax