Added the function to create the JSON file to send to the database in a post.