fetches data from databse