api/server: extract loadConfig from RunServer.