Added json calls around returned dicts with error info.