Catch ValueError and TypeError when parsing a date submitted to the API