Better error handling

If segmentation fails, send a 500 error (was failing silently)

Change-Id: I09b8799e788915e0d2b978418c8f5e34cb7eee10