Improve API.

When trying to get a single object, inspect the path to make sure that
is the case. The last path component should be a valid ObjectID, so use
that in the querydict. Without this change the QuerySet returned by this
object are the entire collection, which is then filtered down. With this
change only the matching results will be returned, which should improve
performance on large collections.

Fix a bug where someone could specify a size or schema_version parameter
that does not cast to an int properly which would throw an exception.
Now, if the cast doesn't work we just use the string which will end up
returning an empty result.