........S. [ZBXNEXT-2519] fixed SQL error and few memory leaks when processing HTTP request by api server