automatic save() is in 'after_request' because it is not supposed to save if there is an exception