Improved api wrapper