Fixed routes and added media upload function