Added nested callbacks to support  asynchronous request processing