allow API to be loaded from multiple directories
some tweaks to the way paths are loaded