Returns proper response to ajax call and removes console.log