Changed when error handling messages appear and fixed code so that we don't try and send the notebook to the flask after the format is invalid