Finished debuging the error handling for empty tables. Server does not crash if there is an empty table.