Allow category filtering to work properly.
Refactor error handling into apiFail().
Factor out category lookup from API code.
Split posts into YAML headers and post text on "get post" request.