public async Task<ActionResult> InstagramSearchAsync(string query, string code)
        {
            var model = new InstagramSearch() { Query = query, ResultsXml = string.Empty };

            if (string.IsNullOrEmpty(query))
            {
                return this.View(model);
            }

            query = query.Replace(" ", string.Empty);
            
            var oauthResponse = InstagramAdapter.GetOAuthResponse(code);
            
            if (oauthResponse == null || oauthResponse.User == null || oauthResponse.AccessToken == null)
            {
                return this.View(model);
            }

            if (query.StartsWith("lat:", StringComparison.InvariantCulture))
            {
                if (!query.Contains(',') || !query.ToLower().Contains("lat:") || !query.ToLower().Contains("lon:"))
                {
                    return this.View(model);
                }

                var coordinates = query.Split(',');
                var lat = Convert.ToDouble(coordinates[0].Replace("lat:", string.Empty), CultureInfo.InvariantCulture);
                var lon = Convert.ToDouble(coordinates[1].Replace("lon:", string.Empty), CultureInfo.InvariantCulture);
                model.ResultsXml = await InstagramAdapter.SearchAsync(lat, lon, oauthResponse);
            }
            else
            {
                model.ResultsXml = await InstagramAdapter.TagsAsync(query, oauthResponse);
            }

            return this.View(model);
        }