Fixed error message to come back as json