Add error handling, session support, adjust documentation accordingly