Feature/fix content types

I'm opening this pull request now even though the issue isn't fully fixed yet so that people can comment on it and give suggestions and such. 

Basically, the issue is that there are pages with a `Content-Type: text/xml` but the page is just text so some javascript is not happy. This aims to return the correct type and not just `text/xml`