Updated API handling