Refactoring coding style and add stream close for KKAPIRequest