Refactored ajax call - added type as post