it is the same as a car, some car's brake systems if you run them dry, you have to bleed the trapped air around the lines.
pump the lever, hold the leaver down, crack the pipe slowly, some air and brake fluid will come out, tighten the pipe/ bolt up and release the lever, do that till there is no air.