wrong js command for sub
clean out models code, add json generator