fixed issues causing Slim errors for function calls and updated returned json format