controller for fetching the json data from sever