The correct fix is
but it’s too big a change than I’m confortable merging at this point
Instead, I’m going to fix each “endpoints” one by one to make it simpler to review and less risky.
Here’s first step