change error handling
replaced direct db calls with wrappers and checked for null readers
Merge branch 'feature/add-error-handling'