fixed json request -- moved into callback