add comment, divide logic on rest api and handle document