Add DB API to get specified state of taskdetails

return value is Object.