add support to return custom json with custom error code to mobile