integrated new API in viewer #5