Add updateOrSave function to API service