Update webserver.js

Tighten code around sending xml data
Update webserver.js

Forgot this section - also use text/plain mimetype since we're not responding using XML to errors; if we're going to do that, we need to do it right in the first place.
Merge pull request #56 from damianb/patch-2

Update XML responses - webserver.js