Finished all API functions and testing