firebase api is so inconsistent