refactor: add exception handling to report db errors / no data from query