Created uidAPI

And moved uid generation to it.