Added a better error message when a posted date to the API is invalid