Serial execution of asynchronous functions