Ensure functions query their respective endpoints.
Merge pull request #2 from daenney/too-much-copy-paste

Ensure functions query their respective endpoints.