implemenation of resource api