added some debug console.logs to the /upload method