Added collectResults which puts the posted json into the database
Collect results now corectly adds elements to database