cleanup and send svg to server