A much better decoupled design for the api