cleaned up some of the server stuff and started api file