Added mouseout listener and fixed the routes for saving