defined expected json and handling it on client code