Extracted ApplicationController in separate js file. Changed http into resource in sessions module