Pipes api documentation and tidying up