Middletier JS API improved