Added basic database call to retrieve threads