add expire support and tests

Change-Id: I3e567c39701b4ead814934d0a0b8275fcc0cedb3