refactored out error object from dbhandler to controllers