Introduced API module, separated API query from executor in preparation for query re-tries