Added SQL write function to the backend server