serialize server into a string