Add __attribute__((warn_unused_result)) to API functions