Creating interface for API to facilitate unit testing