Cleaned up upload/query api