restructuring the api to show maclist in the json response along with the count