Defect engineering and conversion of metal-organic frameworks for adsorption and electrical energy storage applications