setting up async tasks to stop server freezing