making sure the the decoded response is passed into document creation