Added JSON parsing for lookup queries