Changed external to api - compiles but untested.