add to_json and as_json to crm module