Adds tasks to db api

And includes unit test cases.

Partially implement blueprint async-glance-workers

Change-Id: I4b11e3531edf7c85d27f2a4e5667b920fe2333e7
Merge "Adds tasks to db api"