Add API unit tests

Adds a base class for unit testing API functions.

Creates the database for API tests from db/models.py rather
than using migrations; they should be tested separately.
Mocks both engine and API RPC clients so those interactions
can be verified and adds shortcut to mock uuid4 generation.

Implements: blueprint api-unit-test-base
Change-Id: I55c4c5204e58069ad1db28729ea2964dc2b3174a
Merge "Add API unit tests"