Moved cURL call to function since I'll be using it a lot