Added graphs for both apis. Refactored