add meck for pri_server
fix names
includes and erlang:apply instead direct call
sed /dd/
issues