Return json on error for a json request
Return json on error for a json request

ajax only covers requests with `X-Requested-With=XMLHttpRequest`.
And change expectsJson to wantsJson. The former also includes ajax requests.

kj415j45/osu-web,LiquidPL/osu-web,ppy/osu-web,nekodex/osu-web,notbakaneko/osu-web,nanaya/osu-web,notbakaneko/osu-web,kj415j45/osu-web,LiquidPL/osu-web,nekodex/osu-web,nekodex/osu-web,LiquidPL/osu-web,LiquidPL/osu-web,omkelderman/osu-web,ppy/osu-web,kj415j45/osu-web,notbakaneko/osu-web,nanaya/osu-web,nekodex/osu-web,notbakaneko/osu-web,kj415j45/osu-web,ppy/osu-web,nanaya/osu-web,omkelderman/osu-web,omkelderman/osu-web,notbakaneko/osu-web,LiquidPL/osu-web,nekodex/osu-web,ppy/osu-web,ppy/osu-web,nanaya/osu-web,nanaya/osu-web,omkelderman/osu-web