Add defaults to api object creation.

When creating a new api object, if primary key and
table name are not provided, use sensible defaults.