Add apply method to Endpoint companion

This allows for endpoint to be created with slightly prettier syntax.

Addresses #88
How about just `r` then?