working ajax with db call