WIP 2

Proof of concept moving logic from API to Endpoint.

Signed-off-by: Stephen Celis <stephen@stephencelis.com>