Fixed bugs in Json Rest Controller