Modify GraphHandler to execute queries asynchronously.