api: add unit name validation