Handle expiry correctly in json response

Go treats json numbers as float64 not int, so currently expiry
information is ignored for json responses since it's treated as an int.