update method for API