Dependent on the language I would think you could add annotation style based validations to the client side code that would be automatically picked up by the deployment system and hence applied to the server side logic. That said I don't (at least to my knowledge) believe that is possible with javascript without modifying the actual client code to fit an api.