Implement proper error handling.

So far, no comprehensive error handling has been implemented. For future stable releases:

  • API/Session error handling
  • Input error handling