Use JSON response from ifconfig and swith order

The original method is a lot faster (at least for me)
Also, the original function did not work for me, so I changed it to JSON.
Otherwise the entire layout is screwed up and the JSON API doesn't work anymore.