Data storage management with javascript