renamed functions, made all_key return as a list
added match, added more guards to api funcs