Added some generics methods for a more OOP-oriented access to the API.