api: add test coverage for unit name validation, change response codes