Use APIs instead of external libs. Closes #1