Change hacked-together JSON retrieval code to use request