add api and clear redirect methods