make sure "id" comes last in the encoded JSON string