added js functionality to apparatus