add and update api