Added generic function for querying the database and added get videos by category with and without sorting by video Rating