written loop to take postings from api to create a new post object in database