create update method for $resource