try {
if (query.output.equals("json")) {
responseWriter = new JsonWriter(response, gzip);
} else if (query.output.equals("memento")) {
responseWriter = new MementoLinkWriter(request, response, query, gzip);
} else {
responseWriter = new PlainTextWriter(response, gzip);
}
AuthToken authToken = super.createAuthToken(request);