diff --git a/epicardium/api/genapi.py b/epicardium/api/genapi.py
index c6cefc927bd7a1bac3729208302f91a9c57811d5..9f24fa2100733fdb7a8b7c03af8e7739956c5510 100644
--- a/epicardium/api/genapi.py
+++ b/epicardium/api/genapi.py
@@ -150,18 +150,18 @@ def main():
 /* Autogenerated stub for {id} */
 {return_type} {name}({args_str})
 {{
-        const int size = {total_size};
-        void*buffer;
+        const int epc__apistub_size = {total_size};
+        void*epc__apistub_buffer;
 
-        buffer = _api_call_start({id}, size);
-        /* TODO: Check if buffer is not NULL */
+        epc__apistub_buffer = _api_call_start({id}, epc__apistub_size);
+        /* TODO: Check if epc__apistub_buffer is not NULL */
 
 """
             f_client.write(tmp.format(**decl))
 
             for i, arg in enumerate(decl["args"]):
                 tmp = """\
-        *({type}*)(buffer + {offset}) = {name};
+        *({type}*)(epc__apistub_buffer + {offset}) = {name};
 """
                 f_client.write(tmp.format(**arg))
 
@@ -169,14 +169,14 @@ def main():
                 # Don't return if return type is void
                 tmp = """\
 
-        _api_call_transact(buffer);
+        _api_call_transact(epc__apistub_buffer);
 }}
 """
                 f_client.write(tmp.format(**decl))
             else:
                 tmp = """\
 
-        return *({return_type}*)_api_call_transact(buffer);
+        return *({return_type}*)_api_call_transact(epc__apistub_buffer);
 }}
 """
                 f_client.write(tmp.format(**decl))
@@ -249,7 +249,7 @@ void __dispatch_isr(api_int_id_t id)
 #include "modules/log.h"
 #include "{header}"
 
-void __api_dispatch_call(uint32_t id, void*buffer)
+void __api_dispatch_call(uint32_t id, void*epc__apistub_buffer)
 {{
         switch (id) {{
 """
@@ -264,13 +264,13 @@ void __api_dispatch_call(uint32_t id, void*buffer)
             else:
                 tmp = """\
         case {id}:
-                *(({return_type}*)buffer) = {name}("""
+                *(({return_type}*)epc__apistub_buffer) = {name}("""
                 f_dispatcher.write(tmp.format(**decl))
 
             for i, arg in enumerate(decl["args"]):
                 arg["comma"] = "" if i == 0 else ","
                 tmp = """{comma}
-                        *({type}*)(buffer + {offset})"""
+                        *({type}*)(epc__apistub_buffer + {offset})"""
                 f_dispatcher.write(tmp.format(**arg))
 
             tmp = """