api improvements

This adds a [basic logging statement](https://github.com/stenington/CSOL-site/blob/48f3172ca7a4d98896fd62f60262087025780c2d/api.js#L90) for api calls that logs the method, endpoint and status code or error of the request.

It also treats the origin + endpoint concatenation a bit more robustly by using node's `url` module.