Add some validation to the endpoint