API Improvements

Some changes to the API methods and some basic exception handling.