Fixed Upload API.  Wrote upload test