Contents API get as type

This adds a `type` parameter to GET requests to the contents API. There are two main benefits:

1. Clearer failures if you try to fetch a directory but the path points to a file, or vice versa.
2. Notebooks can be opened as text files (`type=file`), and notebooks without a `.ipynb` extension can be opened as notebooks (`type=notebook`)
it's actually raising 400