Updated the sql controller to add some new methods