Added code for API part