API tweaks

Initial work on API and looking at indexes for query patterns.
looks a little cleaner, i'll use the try method instead of raising an error