Add new constructor which takes an Endpoint instance