ENH: Enhanced the completion algorithm in the webserver