update api for add or update attributes