refactored to use async callbacks in server, router, and requstHandler