fixed a bunch of server errors caused by improper exception handling