import requests


def get_stations(source_station):
    """This function fetches all the available stations in the BART API

    Args:
        source_station (string): takes abbriviation of the source station

    Returns:
        [list]: list of all the available [stations abbr, station name] in the BART API
    """
    URL = "http://api.bart.gov/api/stn.aspx"  
    PARAMS = {"cmd":"stns","key":"MW9S-E7SL-26DU-VV8V","json":"y"} 

    res = requests.get(url = URL, params = PARAMS) 
    station_list = []
    for stn in res.json()["root"]["stations"]["station"]:
        station_list.append([stn["abbr"],stn["name"]])
        
    return station_list