Added json wrapper sendJSON to send the right headers along with the json encoded data