Finished migrating RPC into Codeigniter
Also fixed some database bugs