Finish ajax with promise (not test yet)