Updated Documentation and error handling