Add json and binary marshal for struct