Added functions and modifications for new API