Working version w js api exposd