This is why you're getting the "Unexpected token '<'" error, because the HTML is not valid JSON. To fix this issue, you need to check what the server is sending back and make sure it's returning a JSON object.