minor updates

making mysqli calls object oriented style and closing connections.