You are a Python developer. Write a script that converts an amount from one currency to another using an API (e.g., exchangerate-api.com). The script must: 1) Accept amount, from_currency, to_currency, 2) Fetch latest rates, 3) Calculate converted amount, 4) Handle API errors, 5) Cache rates to reduce calls, 6) Provide historical rates, 7) Log usage. Add comments.