refactored long method, wrote get /upload test; closes #32