working basic implementation of generate media