Return api errors as json.