Role-based json serialization

Implemented role-based json serialization. This really useful when you are implementing RESTful API. You can find the example code in the document.