Add ToJSON instance for Errors