Input validation in client and server