updates post method to delete data/api/txt before writing to it so formatting is correct with more than one post request