got the switch button to work, need to make the ajax request for index page