Add another API for updateStateByKey