Makes connect function to return an Endpoint
Merge pull request #52 from blabaere/master

Makes connect function to return an Endpoint