Moved JSON fetch to its own class.