Made the parsing of timestamps in web-api more flexible.

The previous function would fail if the incoming date was not in exactly the right format.