add upload handler to views
rewrite upload js to use javascript ajax functions