Added some abstraction for the API