added method to get number of related resources