def __json__(group=None):
        _json = {
            'id': fields.Integer,
            'location': fields.String,
            'uri': fields.Url('apartment')
        }

        if group == 'flat':
            return _json

        from app.models import Room
        _json['rooms'] = fields.List(fields.Nested(Room.__json__('flat')))

        return _json
    def __json__(group=None):
        _json = {
            'id': fields.Integer,
            'firstName': fields.String,
            'lastName': fields.String,
            'email': fields.String,
            'telephoneNumber': fields.String,
            'uri': fields.Url('user')
        }

        if group == 'flat':
            return _json

        from app.models import Room
        _json['room'] = fields.Nested(Room.__json__('flat'))

        return _json