fix the read API so it works nicely when viewing different branches