Latest changes

Added error handling, log handling, and improved data access