Adding session factory to rest api config