Update restapi.js

* For Android, objects need to be stringified before logging
* Some `;` and `==` and global fixes found via JSLint
* Debug actual server response instead of parsed JSON