Compile api with all optimizations.