Fix exception handling in server.py

Didn't keep up with Algorithm changes.