Api module and several fix