Starting API

Starting to build an API
Changing most AJAX content over to MySQLi

There's a few commits that need to be cleaned up - this is most of them.