api and task for cleaning up UI records