wip: make upload generic and call API