Fixed 500 error on branch and tag creation via UI

Also fixes issue with branch/tag removing via UI

Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>