For the API calls to work and not return 404, permalinks under Settings -> Permalinks must be set to "Post name".