Added strict checking
Clean up code
Rewrite request and response
Rewrite data receiving
Rewrite response processing
Fixed request variable error
Added `API error` catching
Merged request write and end calls