custom endpoint calls complete
code cleaning and testing