Fix misc. bugs
Standardize SDK output to JSON string