Cleaned up server

Added additional error handling.
Removed query print out.
Removed a useless function.