Modified getPosts() to call getJSON