Check for the mainApiFile in directories in GOPATH

The $GOPATH could represent severals directories. This code first checks
in which directory the mainApiFile is located