Add json error reporting for new context api