Async example of structured query endpoint