adding code for fetching data and populating db