First of all the issue was coudn't resolved host which wasn't primary issue though. But after getting comments from this post i realized why that happened. Then the primaty issue i got which was server getting me timed out after certain time.
Well, the issue is the default server of php i am using for laravel which can handle only single request at a time so when i was making request through url it coudn't handle multiple request at a time (browser request + api request) so i have to switched apache server which solved the problem of the time out.
#thanks