Completion of first version of API including compile fixes.