Better XML output from the API

The API now uses a custom Response class to grant it more control over
the output than the previous View offered.