559 media api

first task of #559