Add input validation on server side