updates endpoints.py. fixes Python 3 except statement syntax.