Fix 500 error for API Pulseheight fits with an error_message