added API and tests for the build command