Incorporated rapidjson error handling