updated api for join associations; fixed unit tests