Fixing issue with API call.

Previously I had hardcoded the date being sent to the API, it now uses the current date at the time the script runs. Also fixed an issue in the plain text digest code.