“But to a Being absolutely in need of nothing, no one of His works can contribute anything to His own use.  Neither, again, did He make man for the sake of any of the other works which He has made.  For nothing that is endowed with reason and judgment has been created, or is created, for the use of another, whether greater or less than itself, but for the sake of the life and continuance of the being itself so created ....

“Therefore, ... it is quite clear that although, according to the first and more general view of the subject, God made man for Himself ... yet, according to the view which more nearly touches the beings created, He made him for the sake of the life of those created, .... For to creeping things, I suppose, and birds, and fishes, or, to speak more generally, all irrational creatures, God has assigned such a life as that; [but not] to those who bear upon them the image of the Creator Himself, and are endowed with understanding[.]”

I am quoting from Athenagoras of Athens, On the Resurrection of the Dead, Chapter 12.  Immanuel Kant wrongly gets credit for this insight because he wrote that we are always to be treated as ends, not as means.  But even apart from the fact that he came sixteen centuries later than Athenagoras, Kant meant something quite different, and I think he was confused.