Updated API calls for optional params

Added optional parameters stringbuilding for pins, also fixed heatmaps
optional parameters. Specifying them as empty by just having parameter=
will cause the parameters to be null and the API to complain that you're
sending it crap values. So this fixes it.

As noted in my comments, if the format of my oneline if statements
offend you, then you can format them however you like.