api: handle id on creation