error message in controllers as json