added tests and HEAD method for magic upload