Properly handling JSON-level errors and returning them back as go errors