adding method for rest api