Improved authorization and added SQL support.