Added function to get ratification data from the database