General cleanup
Separating apis and mod code