added code for apis