Added code to gather information from the database and output it in JSON form.