More detailed logging for API module and possible memory leak fix