Refactor custom server instantiation
Type check custom startServer