make endpoint handler add methods chainable; fix dependency in Endpoint; add Endpoint tests