implement twitterAPIRequest
leverage decoupled twitterAPIRequest function, add missing frees in error paths