added registration to js api