Functions created to fetch from the database and to also handle conversion to CSV