Added refcount function to all JSON files