fixing various bugs
switch to libjson and libcurl almost complete. the sample works again but some functions might still be broken.