Added 'contains' and 'to_json' functions