Move function declarations to an header.
Cleanup API prototypes.