Added JSON header encoding
Removed JSON library in favour of manual header creation