Renamed state.m to api.m to better reflect it's intent.