Set uid during object create

Still need to add some unit tests.

Circular reference - I had him move it to api/ since it deals with internal objects (api/meta/* deals with opaque objects)