'Entry point for REST interface.
@param r: the S3Request instance
@param attr: controller attributes'

def apply_method(self, r, **attr):

    http = r.http
    method = r.method
    representation = r.representation
    output = {}
    if (method == 'mform'):
        if (representation == 'json'):
            if (http == 'GET'):
                output = self.mform(r, **attr)
            else:
                r.error(405, current.ERROR.BAD_METHOD)
        else:
            r.error(415, current.ERROR.BAD_FORMAT)
    else:
        r.error(405, current.ERROR.BAD_METHOD)
    return output
