refactor api into another module
declare type for api
rough sketches for media manager and storage backend