Fix: Correctly return JSON on invalid authentication errors
Because we're customising the way that the response goes out, we need to
make sure that we correctly return JSON as a content-type, otherwise we
default to text/plain
, which is incorrect.
Closes #307 (closed).