How can I see studies via the TWS API?

Powered by IBot
How do I obtain historical data via API?
Where can I download the TWS API?
Do you offer tick-by-tick data via the API?
Are stock loan borrow rates available via the API?