sort out server startup and return promise