Rework API unit tests

We should be stressing the api interface not the db interface. Also
remove a lot of redundant code.

Change-Id: I559ad94b1f4fd2cb1d269e997f1a783668daa728
Signed-off-by: Paul Belanger <paul.belanger@polybeacon.com>