Added ajax functionatliy for get and post requests