The code was using the HTTP Header "Accept" parameter as primary for the
returning document type. This clashed when a user explicitly used the
GET['format'] attribute.

Now the GET['format'], when valid, has priority over the HTTP Accept