fix ajax call to work on server