API improvements from angular branch.
Integrate angular branch jsonformat changes.