add last online time for device, refactor update destroy for json