Handle expiry correctly in json response

Go treats json numbers as float64 not int. Previously json response
expiry information was ignored since it was expected to be an int.