Added another layer of abstraction that makes the API a lot easier to work with. Needs testing.