Helper function for getting JSON data.

Will add XML helper later.