BUG Fix subsite document ID generation

Because `json_encode` would encode subsite id 0 (int) differently to subsite id "0" (string), records would occasionally not match when saving against any subsite.