change status responses and json output on error