Refactor build API and controller

Refactor the build API and validation. Refactor the build controller
to use the upstream cache package where possible. Use watches wherever
possible.
@ironcladlou Is this needed since you have line 53?