Return errors in JSON as well.