refine the API. TODO : Modify for the updated protocol
updating the main.hs
rm backup files