Make error-handling better (500 instead of crashing most of the time)