refactor mediacore into its own module and add rest endpoint