Fixed error handling, improve key formatting, strip __metadata, add date handling