add upload functionality and basic tests