changed send method to json in controllers