Extended addToLocalTableWithData

changed return value of addToLocalTableWithData to be an array of
inserted ids