error handling and dao layer (work in progress)