Endpoint logic