Changed the http response messages for invalid data being passed from OK to BadRequest
Started a function for date validation