Reduce cyclomatic complexity
Added kong error handling