making homepage work with JSON