Initial Gateway code
Improved data uploading