Added tests for get_or_build.
Updated code to support edit category.