Revert "Remove Endpoints monkey patch"

This reverts commit ab59fb09cb2b9ca1a3f8a1a9fd63d2327655935f.