refactor(main) sendResponse