upload function added + location API