Finally, it works

Apparently you need to parse all input and return {ok,_Result}