Started fixing media json output as well as some other minor tweaks.