added json flag to request
uploads now polls for upload status and return only after file is completely uploaded