Cleaned up api

Cleaned up Sql Connection