Adding API Functionality for Ajax Purpose