legal requirements for building