'Entry point for REST API
@param r: the S3Request
@param attr: controller arguments'

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

    if (r.representation == 'json'):
        table = current.s3db.cms_tag
        tags = current.db((table.deleted == False)).select(table.name)
        tag_list = [tag.name for tag in tags]
        output = json.dumps(tag_list, separators=SEPARATORS)
        current.response.headers['Content-Type'] = 'application/json'
        return output
    raise HTTP(405, current.ERROR.BAD_METHOD)
