API fixes

2 commits in this one for the API.

First one:
https://github.com/danielbush/fez/commit/95a11b66819d03d4ce9bff22b79d6a9ce1d0ce16
affects code in public/.

Second one:
https://github.com/danielbush/fez/commit/f475a420ba76bb7a8682c3e153220c4e037f0d48
affects code in tests/api .