Membership plugin PHP Api

I need to carry out some membership control on elements of a page within the template. Is there a PHP api that I can use to get things like the current users subscription level etc? the manual doesnt mention one.