fixing bugs and adding to api fetching of all media objects in xml and json