send 204 or 401 response codes instead of 300s (when apiMode is enabled)

this includes my commit from https://github.com/spumko/travelogue/pull/54