ensure json is always sent on 2xx responses