pub fn valid_data_as_ref<T: Any, R: Any>(data: &Data) -> bool
fn to check if a type can be accessed in a route as reference