helpers functions for json manipulation on request and response