client side model creation and validation