modified media lib and api