Refactored the sessions controller to extract api stuff