Added read and write listeners to process requests asynchronously.