Added function to pull both text and json through