Update javascript and add some test for models