Solved various errors from empty tables

Edited code in the GUI and server to prevent errors caused when no
stocks existed in the database prior to the call or no transactions
existed in the database prior to the call.
A working database now only requires that a customer be present.