restructured error handling. finished first iteration of server
(currently untested). added error files