Added most APIs, cleaned up some code