added friends api and minor fixes