Added JSON parsing and removed commented code