Update database queries to throw exceptions upon failure instead of just
returning random values.
Clean up UI code.