Handle the JSON in the worker