centralizing uint8array -> string function, also handling response types a bit more gracefully in api code.