Closes #8. Split up API functions