write endpoint for writing data w/ AJAX