QR API implementation
Merge branch 'QR_API'
Clean up and integration with QR_API