OOP refactor and added AJAX to get JSON