Merged ajax handler into main file