Refactor out endpoint declaration duplication. Close #93.