Refactored log and changed completely to my own api