Reworking server to use async and globals.