Added catching of errors from responses