API cleanup and fixes