Adding error handlers

Adding error handlers, updating documentation