Improved API. Added function attributes