replaced simple get_value_of_key_from_json method by a flexible recursive function