Code cleanup

Backend bracket clean up, added error when adding a category in itself