Added handling of circular references
json support