Optimize by making temporary variable a const ref
Macro for registering API functions