Define model in js