creating session controller for api