Fixed variable checking @ category controller
Added apitest