Output errors in JSON format