More API cleanup + proper API handling