Merge/json api related commits

cc @georgestephanis