Passing endpoint around wasn't needed as you pointed out (when I walked through the code again). Removed it