model layer added to javascript