added const char * and char * for toJson() function