sends JSON on error regardless