refactor server routes validations