Make async server threadsafe and actually asynchronous