Structured query API improvements