Cleaning up error handling, changing TTL to be in seconds for metadata