Finished the database interface for the GUI.