main entry point returns status code