Encapsulate some more and fix JSON.stringify and example server