Tried fixing javascript ajax request and response