added validation of input to POST routes