refactor(server.go) do not construct the string if not necessary